var vm = new Vue({
    el: '#main',
    data: {
           versionDatas:[],
           pagination: [],
            versionObj:{
                systemNo:'',
                systemName:'',
                systemChargePop:'',
                systemPhone:'',
                systemPhoneType:'',
                systemUrl:'',
                systemDateUrl:'',
                serverConStr:'',
                password:'',
                fileUrl:'',
                fileName:'',
                autoFlag:'1',
            },
            editObj:{
                versionNo:'',
                versionUpdateTime:'',
                versionUrl:'',
                versionCopyUrl:{},
                fileName:'',
                sysversionId:'',
            },
            nowPage:1,
            rowNum:10,
            allPages:0,
            Obj:{},
            flag:true,
            tips:'',
            sysversionId:'',
            pagesArr:[],
    },
    created: function () {
        this.Obj = sessionStorage.getItem('obj')
        this.versionObj = JSON.parse(this.Obj);
        let routerData = window.location.search;
        let ar = routerData.split('=');
        this.sysversionId = ar[1];
        this.getData();
    },
    methods:{
        //查看页面
        lookPage(sysversionId,fileName){
               window.location.href = 'sysPages.html?sysversionId=' + sysversionId + '&fileName=' + fileName;  // 原跳转页面
        },
        //保存
        check_c(){
            let obj = {
                systemNo:this.versionObj.systemNo,
                systemName:this.versionObj.systemName,
                systemChargePop:this.versionObj.systemChargePop,
                systemPhone:this.versionObj.systemPhone,
                systemPhoneType:this.versionObj.systemPhoneType,
                systemDateUrl:this.versionObj.systemDateUrl,
                id:this.versionObj.id,
            }
            axios({
                method: "post",
                url: App.envUrl.backtrackUrl+"sysMaintain/updateSysMaintain",
                data: obj,
            })
            .then((data) => {
                if(data.data.code === '200'){
                    window.location.href = 'systemMaintenance.html';
                }
            })
            .catch((err) => {});
        },
        radioChangez(val){
            this.versionObj.autoFlag = '1';
         },
         radioChanges(val){
             this.versionObj.autoFlag = '0'
         },
        //返回
        back(){
            window.location.href = "systemMaintenance.html";
        },
        //列表
        getData(){
            let obj = {
                sysversionId: this.sysversionId,
            }
            axios({
                method: "post",
                url: App.envUrl.backtrackUrl+"versionurl/queryVersionUrl",
                // url: "http://192.168.1.61:8080/slxt-web/versionurl/queryVersionUrl",
                data: obj,
            })
            .then((data) => {
                if(data.data.code === '200'){
                    data.data.data.forEach((item)=>{
                        item.fileUrl = item.fileUrl.slice(4);
                        item.fullUrl  = 'https://www.bjnfbk.com/'+item.fileUrl+'/'+item.fileName;
                    })
                    this.pagesArr =data.data.data;
                    console.log(this.pagesArr)
                   
                }else{
                    parent.showAlert(data.data.msg);
                }
            })
            .catch((err) => {});
        },
    }
   
});
